<template>
  <div class="content">
    <div>
      <!--      一般组件-->
      <banner/>
    </div>
    <h1>Vue Router Demp</h1>
    <hr>
    <div class="container">
      <div class="nav">
        <!--        vue借助router-link实现路由的切换,本质上router-link是a标签-->
        <!--        active-class:router-link不能绑定事件,当你在跟路由对话的时候,就会加上该属性-->
        <router-link to="/about" class="router" active-class="active">About</router-link>
        <router-link to="/home" class="router" active-class="active">Home</router-link>
      </div>
      <div class="show">
        <!--        指定组件呈现的位置-->
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
import banner from "./components/Banner.vue";

export default {
  name: 'App',
  components: {banner},
  methods: {}
}
</script>

<style scoped>
.content {
  width: 1200px;
  height: 800px;
  margin: 0 auto;
}

.container {
  display: flex;
}

.router {
  display: block;
  width: 100px;
  height: 30px;
  border: 1px solid black;
  line-height: 30px;
  text-align: center;
  color: black;
  outline: none;
  text-decoration: none;

}

.active {
  background-color: #4444ed;
  color: white;
}

.active a {
  color: white;
}

.show {
  margin-left: 20px;
  width: 200px;
  border: 1px solid blanchedalmond;
}
</style>
